//
// FiexedPointMethod.h
// Fixed point method implementation.
//
// Author: Gabriel H. Barbuto (gbarbuto@dc.uba.ar)
//
#ifndef _FIXED_POINT_METHOD_H_
#define _FIXED_POINT_METHOD_H_

#include <cstddef>
#include <functional>
#include <vector>

#include "IterativeMethod.h"
#include "TP1MetNumDLL.h"
#include "UnaryIterativeMethod.h"

class FixedPointMethod : public UnaryIterativeMethod
{
public:

	TP1METNUMDLL_API FixedPointMethod(std::function<double(double)> const &g, std::size_t const &iterations);

	TP1METNUMDLL_API FixedPointMethod(std::function<double(double)> const &g, double const &epsilon = IterativeMethod::default_epsilon(), std::size_t const &iterations = IterativeMethod::default_iterations());

	using UnaryIterativeMethod::operator();

	TP1METNUMDLL_API virtual double operator()(std::vector<double> const &arguments);

private:

	const std::function<double(double)> _g;
};

#endif

